<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		
		<meta name="Description" content="" />
        <meta name="Keywords" content="" />
        
		<title>XSLT Templater - Documentation</title>
		
		<link href="style.css" rel="stylesheet" type="text/css" />
		
	</head>

	<body>
	
		<div id="menu">
			<a href="index_en.html"><img src="XSLTTemplater_200.png" alt="XSLT Templater"/></a>
			<ul>
				<li>
					<a href="#plugin" title="About plugin">About plugin</a>
				</li>
				<li>
					<a href="#calling" title="Different ways of calling">Different ways of calling</a>
				</li>
				<li>
					<a href="#callbacks" title="Callbacks">Callbacks</a>
				</li>
				<li>
					<a href="#ucache" title="Working with user cache">Working with user cache</a>
				</li>
				<li>
					<a href="#mucache" title="Methods of user cache">Methods of user cache</a>
				</li>
				<li>
					<a href="#bcache" title="Working with basic cache">Working with basic cache</a>
				</li>
				<li>
					<a href="#sbcache" title="Setting of basic cache">Setting of basic cache</a>
				</li>
				<li>
					<a href="#httpcache" title="Automatic caching of requests">Automatic caching of requests</a>
				</li>
				<li>
					<a href="#example" title="Comprehensive example">Comprehensive example</a>
				</li>
				<li>
					<a href="#info" title="Extracting information about the plugin">Extracting information about the plugin</a>
				</li>
			</ul>
		</div>
		
		<div id="content_block">
			<h3><a name="plugin">About plugin</a></h3>
			<p><strong>XSLT Templater</strong>  - plugin for jQuery  framework, implementing the following tasks:</p>
			<ol>
				<li><strong>XML/XSLT processing </strong>
					<p>The plugin allows to perform XSLT transformations for xml and xsl arguments. And the xml and xsl can be in three forms:</p>
					<ul>
						<li><em>String representation</em>
							<p>In this case the plugin will parse the string representation of XML and make all necessary calculations.</p>
						</li>
						<li><em>Link to a file / resource</em>
							<p>Plugin with AJAX will load necessary data from an outer source (within the domain) and make the necessary changes.</p>
						</li>
						<li><em>XMLDocument</em>
							<p>In such situation, the plugin will not produce any additional operations, but will immediately use the argument in the form of XMLDocument in XSLT processing.</p>
						</li>
					</ul>
					<p>Three forms of representation allow creator to customize your caching system for organizing specific templating.</p>
				</li>
				<li><strong>Caching of XML / XSLT at three levels</strong>
					<p>Caching allows organizing the storage of xml / xsl for the reuse, and that realizes the basic features for templating with the computing capability XSLT. Caching is organized at three levels:</p>
					<ul>
						<li><em>User level</em>
							<p>User cache himself accessing to the last transformation results.</p>
						</li>
						<li><em>Basic Level</em>
							<p>Enabled by default internal cache of plugin, which caches only the xsl resources in default mode.</p>
						</li>
						<li><em>HTTP Level<sup>(v.&nbsp;0.0.4+)</sup></em>
							<p>Intelligent caching of asynchronous requests, based on http headers.</p>
						</li>
					</ul>
					<p>Caching is made only for arguments with a string type, such as the string representation of the xml, or link to a resource.
					All levels of caching can be used together, though they are completely independent.
					Internal caching means that one user controls the order of calls of some transformations
					over the same input data. In other words, two identical successive conversion calls will work with
					the same state of the cache because of asynchrony, which means that the same resources can be
					downloaded many times. However, there is a mechanism enabling to organize the chain of
					transformations, based on the callbacks. This mechanism allows clearing all calling options,
					which makes possible to use of the actual state of the cache in each conversion.</p>
				</li>
			</ol>
			<p>The plugin supports the following browsers: <em>IE 6+, Firefox, Opera, Chrome, Safari</em></p>
			
			<h3><a name="calling">Different ways of calling</a></h3>

			<p>The transformations can be carried for the resulting representation in the context of the the container element, as well as out of element context<sup>(v.&nbsp;0.0.5+)</sup> - the result of conversion is stored only in the cache. The source xml and xsl are both presented in three different forms:</p>
			<ul>
				<li><strong>String representation</strong>
					<p>Let us assume that there are following string representations:</p>

<pre class="javascript" style="font-family:monospace;"><span style="color: #3366CC;">&quot;&lt;xml-message&gt;&quot;</span><span style="color: #339933;">+</span>
<span style="color: #3366CC;">&quot;&lt;message&gt;It working with string representation of xml&lt;/message&gt;&quot;</span><span style="color: #339933;">+</span>
<span style="color: #3366CC;">&quot;&lt;/xml-message&gt;&quot;</span></pre>

					<p>and</p>

<pre class="javascript" style="font-family:monospace;"><span style="color: #3366CC;">'&lt;?xml version=&quot;1.0&quot;?&gt;'</span><span style="color: #339933;">+</span>
<span style="color: #3366CC;">'&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;'</span><span style="color: #339933;">+</span>
<span style="color: #3366CC;">'&lt;xsl:template match=&quot;xml-message&quot;&gt;'</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">'&lt;p&gt;Result: &lt;xsl:value-of select=&quot;message/text()&quot;/&gt;!&lt;/p&gt;'</span><span style="color: #339933;">+</span>
		<span style="color: #3366CC;">'&lt;/xsl:template&gt;'</span><span style="color: #339933;">+</span>
<span style="color: #3366CC;">'&lt;/xsl:stylesheet&gt;'</span></pre>

					<p>Then xml / xsl transformation will be the following:</p>

<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;xml-message&gt;&quot;</span><span style="color: #339933;">+</span>
<span style="color: #3366CC;">&quot;&lt;message&gt;It working with string representation of xml&lt;/message&gt;&quot;</span><span style="color: #339933;">+</span>
<span style="color: #3366CC;">&quot;&lt;/xml-message&gt;&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'&lt;?xml version=&quot;1.0&quot;?&gt;'</span><span style="color: #339933;">+</span>
<span style="color: #3366CC;">'&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;'</span><span style="color: #339933;">+</span>
<span style="color: #3366CC;">'&lt;xsl:template match=&quot;xml-message&quot;&gt;'</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">'&lt;p&gt;Result: &lt;xsl:value-of select=&quot;message/text()&quot;/&gt;!&lt;/p&gt;'</span><span style="color: #339933;">+</span>
		<span style="color: #3366CC;">'&lt;/xsl:template&gt;'</span><span style="color: #339933;">+</span>
<span style="color: #3366CC;">'&lt;/xsl:stylesheet&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre> 

					<p>or</p>

<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> xmlString <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&lt;xml-message&gt;&quot;</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">&quot;&lt;message&gt;It working with string representation of xml&lt;/message&gt;&quot;</span><span style="color: #339933;">+</span>
		<span style="color: #3366CC;">&quot;&lt;/xml-message&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> xslString <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;?xml version=&quot;1.0&quot;?&gt;'</span><span style="color: #339933;">+</span>
		<span style="color: #3366CC;">'&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;'</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">'&lt;xsl:template match=&quot;xml-message&quot;&gt;'</span><span style="color: #339933;">+</span>
				<span style="color: #3366CC;">'&lt;p&gt;Result: &lt;xsl:value-of select=&quot;message/text()&quot;/&gt;!&lt;/p&gt;'</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">'&lt;/xsl:template&gt;'</span><span style="color: #339933;">+</span>
		<span style="color: #3366CC;">'&lt;/xsl:stylesheet&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
 
				</li>
				<li><strong>Link to a resource</strong>
					<p>Let us assume that there is a file or script returning the following structure:</p>

					<em>/tests/data/message.xml</em>
					
<pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xml-message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>It working with loading xml file<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xml-message<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre>

					<p>and</p>

					<em>/tests/xslt/message-template.xsl</em>
					
<pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:stylesheet</span> <span style="color: #000066;">xmlns:xsl</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/XSL/Transform&quot;</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:template</span> <span style="color: #000066;">match</span>=<span style="color: #ff0000;">&quot;xml-message&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Result: <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xsl:value-of</span> <span style="color: #000066;">select</span>=<span style="color: #ff0000;">&quot;message/text()&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> and loading xslt file!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:template<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xsl:stylesheet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre>

					<p>In this case calls will be implemented as:</p>

<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/tests/data/message.xml&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;/tests/xslt/message-template.xsl&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>

				</li>
				<li><strong>In a XMLDocument</strong> (see Working with user cache)
				</li>
			</ul>
			
			<p>To calling transformation out of context of element and saving the result of changes in the cache need use the user cache (see Working with user cache):</p>
			
			<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> xsltCache <span style="color: #339933;">=</span> $.<span style="color: #660066;">getXSLTLocalCache</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>xsltCache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>

<p>Comprehensive example:</p>

<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> xslString <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;?xml version=&quot;1.0&quot;?&gt;'</span><span style="color: #339933;">+</span>
		<span style="color: #3366CC;">'&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;'</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">'&lt;xsl:template match=&quot;xml-message&quot;&gt;'</span><span style="color: #339933;">+</span>
				<span style="color: #3366CC;">'&lt;p&gt;Result: &lt;xsl:value-of select=&quot;message/text()&quot;/&gt;!&lt;/p&gt;'</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">'&lt;/xsl:template&gt;'</span><span style="color: #339933;">+</span>
		<span style="color: #3366CC;">'&lt;/xsl:stylesheet&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/tests/data/message.xml&quot;</span><span style="color: #339933;">,</span>xslString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>

			<h3><a name="callbacks">Callbacks</a></h3>
		
			<p>For synchronizing the work of several calls and organizing work with cache there is a callback mechanism:</p>
			
<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/tests/data/message.xml&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;/tests/xslt/message-template.xsl&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	console.<span style="color: #660066;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Text message after transformation!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>

			<p>This mechanism allows organizing the chain of calls. Moreover, each callback will have access to the cache state after the latest call:</p>
			
<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> xslString <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;?xml version=&quot;1.0&quot;?&gt;'</span><span style="color: #339933;">+</span>
		<span style="color: #3366CC;">'&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;'</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">'&lt;xsl:template match=&quot;xml-message&quot;&gt;'</span><span style="color: #339933;">+</span>
				<span style="color: #3366CC;">'&lt;p&gt;Result: &lt;xsl:value-of select=&quot;message/text()&quot;/&gt;!&lt;/p&gt;'</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">'&lt;/xsl:template&gt;'</span><span style="color: #339933;">+</span>
		<span style="color: #3366CC;">'&lt;/xsl:stylesheet&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/tests/data/message.xml&quot;</span><span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/tests/data/message.xml&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;/tests/xslt/message-template.xsl&quot;</span><span style="color: #339933;">,</span>  <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test4'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/tests/data/message.xml&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;/tests/xslt/message-template.xsl&quot;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			console.<span style="color: #660066;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Text message after all transformations &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>

			<h3><a name="ucache">Working with user cache</a></h3>
			
			<p>User (local) cache is needed for self-control caching within the template cache. 
			The local cache is transferred directly to the transformation function,
			that’s why there is access to the latest results of cache changes only.
			If the local cache is passed as an argument, it is necessary to get
			an instance of the local cache:</p>

<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> xsltCache <span style="color: #339933;">=</span> $.<span style="color: #660066;">getXSLTLocalCache</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
	onUnlock<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>state<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		console.<span style="color: #660066;">debug</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'New value in cache'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>

			<p>Now this instance can be used in calls:</p>

<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/tests/data/message.xml&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;/tests/xslt/message-template.xsl&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xsltCache.<span style="color: #660066;">getXmlDoc</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
			 <span style="color: #3366CC;">&quot;/tests/xslt/message-template.xsl&quot;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>xsltCache<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #006600; font-style: italic;">// using result of caching xml representation in callback function</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>xsltCache<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// insert local cache to transformation function and switch off base cache </span></pre>

			<p>In this example you should pay attention to the following features:</p>
			<ul>
				<li><strong>xsltCache.getXmlDoc()</strong> – receiving XMLDocument for xml source from the previous call</li>
				<li><strong>…null,xsltCache,false… for inner call</strong> - null for the callback function, reuse of the local cache, switching off the internal (basic) cache plugin</li>
			</ul>
			<p>So, after processing the first call, there will be a copy of the cache containing XMLDocument for xml and xsl, which can be reused.</p> 
			<p>Using of a user cache allows you to organize the chain of transformations<sup>(v.&nbsp;0.0.5+)</sup> without the need to save intermediate results in the element. To organize the chain of calls is used non-context call:</p>
			<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> xsltCache <span style="color: #339933;">=</span> $.<span style="color: #660066;">getXSLTLocalCache</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'/tests/data/data.xml'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'/tests/xsl/xslt1.xsl'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xsltCache.<span style="color: #660066;">getResultDoc</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'/tests/xsl/xslt2.xsl'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xsltCache.<span style="color: #660066;">getResultDoc</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'/tests/xsl/xslt3.xsl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>xsltCache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>xsltCache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
			<p>As a result of this call will be made the three transformations, the end result of which will be append to the element.</p>

			<h3><a name="mucache">Methods of user cache</a></h3>
			<table>
				<tbody>
					<tr>
						<th>
						Methods
						</th>
						<th>
						Type
						</th>
						<th>
						Description
						</th>
					</tr>
					<tr>
						<td>
						checkResultDoc()<sup>(v.&nbsp;0.0.3+)</sup>
						</td>
						<td>
						boolean
						</td>
						<td>
						It checks cache value of the transformation results. Returns “true”, if the value is set, “false” - otherwise
						</td>
					</tr>
					<tr>
						<td>
						checkXmlDoc()
						</td>
						<td>
						boolean
						</td>
						<td>
						It checks cache values of xml. It returns “true”, if the value is set, “false” – otherwise
						</td>
					</tr>
					<tr>
						<td>
						checkXslDoc()
						</td>
						<td>
						boolean
						</td>
						<td>
						It checks cache values of xsl. It returns “true”, if the value is set, “false” – otherwise
						</td>
					</tr>
					<tr>
						<td>
						getResultDoc()<sup>(v.&nbsp;0.0.3+)</sup>
						</td>
						<td>
						string
						</td>
						<td>
						It returns value of cache of the transformation results. If value is not found, it returns “false”
						</td>
					</tr>
					<tr>
						<td>
						getXmlDoc()
						</td>
						<td>
						XMLDocument
						</td>
						<td>
						It returns value of xml cache. If value is not found, it returns “false”
						</td>
					</tr>
					<tr>
						<td>
						getXslDoc()
						</td>
						<td>
						XMLDocument
						</td>
						<td>
						It returns value of xsl cache. If value is not found, it returns “false”
						</td>
					</tr>
					<tr>
						<td>
						getXmlString()<sup>(v.&nbsp;0.0.4+)</sup>
						</td>
						<td>
						string
						</td>
						<td>
						It returns string value of xml cache. If value is not found, it returns “false”
						</td>
					</tr>
					<tr>
						<td>
						getXslString()<sup>(v.&nbsp;0.0.4+)</sup>
						</td>
						<td>
						string
						</td>
						<td>
						It returns string value of xsl cache. If value is not found, it returns “false”
						</td>
					</tr>
					<tr>
						<td>
						lock()
						</td>
						<td>
						-
						</td>
						<td>
						Service method for verifying the cache working possibility. Information only.  
						</td>
					</tr>
					<tr>
						<td>
						setResultDoc(xml)<sup>(v.&nbsp;0.0.3+)</sup>
						</td>
						<td>
						-
						</td>
						<td>
						It set a new value of cache of the transformation results. Used within the plugin.
						</td>
					</tr>
					<tr>
						<td>
						setXmlDoc(xml)
						</td>
						<td>
						-
						</td>
						<td>
						It set a new value of xml cache. Used within the plugin.
						</td>
					</tr>
					<tr>
						<td>
						setXslDoc(xml)
						</td>
						<td>
						-
						</td>
						<td>
						It set a new value of xsl cache. Used within the plugin.
						</td>
					</tr>
					<tr>
						<td>
						reset
						</td>
						<td>
						-
						</td>
						<td>
						It reset all the cache values
						</td>
					</tr>
					<tr>
						<td>
						unlock
						</td>
						<td>
						-
						</td>
						<td>
						Service method for verifying the possibility of cache workin. Information only.  
						</td>
					</tr>
				</tbody>
			</table>

			<h3><a name="bcache">Working with basic cache</a></h3>
			
			<p>Basic cache used internally by the plugin for optimizing the transformation. Caching is based on a string key (string representation of the xml or link to the resource). There are eight possible states of internal cache:</p>
			<ul>
				<li><strong>caching only xsl - the default mode</strong>
					<p>This mode means that template is loaded only once, and data is updated periodically. In this case, the training template for change will be made only once.</p>
				</li>
				<li><strong>caching only xml</strong>
					<p>In this mode the static data changes only form of representation (template).</p>
				</li>
				<li><strong>caching only xml and only xsl</strong>
					<p>In this case the data and the presentation are both static. As a rule, this option is used when there is re-loading static content uncertainty.</p>
				</li>
				<li><strong>caching only xml and result of transformation<sup>(v.&nbsp;0.0.3+)</sup></strong>
					<p>Typically, such a situation occurs when the template is dynamic resource(various sources) and there is a possibility to re-request a used template. In the case of re-request will be used is already cached value of the result of transformation.</p>
				</li>
				<li><strong>caching only xsl and result of transformation<sup>(v.&nbsp;0.0.3+)</sup></strong>
					<p>Such a situation already occurs when the template is dynamic resource(various sources) and there is a possibility to re-request a used date resource. In the case of re-request will be used is already cached value of the result of transformation.</p>
				</li>
				<li><strong>caching only result of transformation<sup>(v.&nbsp;0.0.3+)</sup></strong>
					<p>Regardless of the actual update data and template repeat request to processed resources will lead to the using of already cached value of the result of transformation.</p>
				</li>
				<li><strong>caching and xml, and xsl, and result of transformation<sup>(v.&nbsp;0.0.3+)</sup></strong>
					<p>In this case, any re-request in independent calls to any of the processed resources will lead to the use of cached values</p>
				</li>
				<li><strong>No caching</strong></li>
			</ul>

			<h3><a name="sbcache">Setting of basic cache</a></h3>
			
			<p>There are eight different caching:</p>
			<ul>
				<li><em>caching only xsl - the default mode</em>

<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> </pre>

				<p>or</p>

<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> cache <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #3366CC;">&quot;xml&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;xsl&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;result&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span>
<span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>cache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>	
				
				</li>
				<li><em>caching only xml</em>

<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> cache <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #3366CC;">&quot;xml&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;xsl&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;result&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span>
<span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>cache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>

				</li>
				<li><em>caching only xml and only xsl</em>
				
<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> cache <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #3366CC;">&quot;xml&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;xsl&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;result&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span>
<span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>cache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
			
				</li>
				<li><em>caching only xml and result of transformation<sup>(v.&nbsp;0.0.3+)</sup></em>

<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> cache <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #3366CC;">&quot;xml&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;xsl&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;result&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span>
<span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>cache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
		
				</li>
				<li><em>caching only xsl and result of transformation<sup>(v.&nbsp;0.0.3+)</sup></em>

<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> cache <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #3366CC;">&quot;xml&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;xsl&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;result&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span>
<span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>cache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
								
				</li>
				<li><em>caching only result of transformation<sup>(v.&nbsp;0.0.3+)</sup></em>

<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> cache <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #3366CC;">&quot;xml&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;xsl&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;result&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span>
<span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>cache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
				
				</li>
				<li><em>caching and xml, and xsl, and result of transformation<sup>(v.&nbsp;0.0.3+)</sup></em>

<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre> 

				<p>or</p>

<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> cache <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #3366CC;">&quot;xml&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;xsl&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;result&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span>
<span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>cache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
				
				</li>
				<li><em>No caching</em>

<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre> 

				<p>or</p>

<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> cache <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #3366CC;">&quot;xml&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;xsl&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span>
	<span style="color: #3366CC;">&quot;result&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span>
<span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>cache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>				
				
				</li>
			</ul>
			
			<h3><a name="httpcache">Automatic caching of requests<sup>(v.&nbsp;0.0.4+)</sup></a></h3>
			
			<p>In the case, when as a resource of XML and XSL using external sources (ie, resources will be requesting with  AJAX), may use specific caching. This caching allows the plugin to automatically cache or re-request external resources based on http headers. Thus, does not require specific actions to ensure timely discharge cache from the developer of client side - enough resources returning with correct headers. As a basis for such caching are the following http headers - Cache-control (perhaps an indication max-age) or Pragma, and Expires.</p>
			<p>To use a such cache, you may set option "ajax" in the configuration of the base cache:</p>
			<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> cache <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #3366CC;">&quot;ajax&quot;</span><span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">true</span> <span style="color: #006600; font-style: italic;">//Also you can use other parameters (such as xml,xsl,result)...</span>
<span style="color: #009900;">&#125;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/tests/data/message.xml&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;/tests/xslt/message-template.xsl&quot;</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span>cache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
			<p>For example, if the external resource is set http header "Expires", then the real asynchronous re-request will be made only after the expiration date specified as the value of this header.</p>
			
			<h3><a name="example">Comprehensive example</a></h3>
			
			<pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> time <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> xmlString <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&lt;xml-message&gt;&quot;</span><span style="color: #339933;">+</span>
				<span style="color: #3366CC;">&quot;&lt;message&gt;It working with string representation of xml&lt;/message&gt;&quot;</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">&quot;&lt;/xml-message&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> xslString <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;?xml version=&quot;1.0&quot;?&gt;'</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">'&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;'</span><span style="color: #339933;">+</span>
				<span style="color: #3366CC;">'&lt;xsl:template match=&quot;xml-message&quot;&gt;'</span><span style="color: #339933;">+</span>
			    		<span style="color: #3366CC;">'&lt;p&gt;Result: &lt;xsl:value-of select=&quot;message/text()&quot;/&gt;!&lt;/p&gt;'</span><span style="color: #339933;">+</span>
				<span style="color: #3366CC;">'&lt;/xsl:template&gt;'</span><span style="color: #339933;">+</span>
			<span style="color: #3366CC;">'&lt;/xsl:stylesheet&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
    	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xmlString<span style="color: #339933;">,</span>xslString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> xsltCache <span style="color: #339933;">=</span> $.<span style="color: #660066;">getXSLTLocalCache</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
		onUnlock<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>state<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			console.<span style="color: #660066;">debug</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Text message after setting new value in local cache!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/tests/data/message.xml&quot;</span><span style="color: #339933;">,</span>xslString<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test3'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xsltCache.<span style="color: #660066;">getXmlDoc</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
				 <span style="color: #3366CC;">&quot;/tests/xslt/message-template.xsl&quot;</span><span style="color: #339933;">,</span>  <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#test4'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">xslt</span><span style="color: #009900;">&#40;</span>xsltCache.<span style="color: #660066;">getXmlDoc</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
							 xsltCache.<span style="color: #660066;">getXslDoc</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
							 <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #003366; font-weight: bold;">var</span> time2 <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#time&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Calculating time:&quot;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#40;</span>time2<span style="color: #339933;">-</span>time<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>xsltCache<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>xsltCache<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
    	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>xsltCache<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;</pre>

			<h3><a name="info">Extracting information about the plugin<sup>(v.&nbsp;0.0.4+)</sup></a></h3>
			
			<p>To clarify the current specification of plugin directly on the client side there is a possibility to obtain information object:</p>
			<pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> infoObject <span style="color: #339933;">=</span> $.<span style="color: #660066;">getXSLTTemplaterInfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> version <span style="color: #339933;">=</span> infoObject.<span style="color: #660066;">version</span><span style="color: #339933;">;</span></pre>

		</div>
		
		<div id="copyright">
			Copyright © 2010 <a href="mailto:tsarev.oi@mail.ru">Oleg Tsarev</a>
		</div>

	</body>
</html>